package carstore.ui.interfaces;

import carstore.ui.models.OrderInfo;
import carstore.ui.models.OrderInfoExt;
import feign.Param;
import feign.RequestLine;
import java.math.BigInteger;
import java.util.List;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//@FeignClient("order-service")
@FeignClient("gateway")
	public interface OrderInfoClient {
	@RequestMapping(method = RequestMethod.GET, value = "/orderserver/allorders")
	    List<OrderInfo> getAllOrders();
	@RequestMapping(method = RequestMethod.GET, value = "/orderserver/ordersbyuser?UserId={UserId}")
	public List<OrderInfoExt> getOrdersbyUserId(@PathVariable("UserId") int UserId);

	@RequestMapping(method = RequestMethod.POST, value ="/orderserver/neworder?orderId={orderId}&orderTime={orderTime}&storeId={storeId}&carID={carID}&userId={userId}&orderStatus={orderStatus}")
	public void setNewOrderInfo(@PathVariable("orderId")  BigInteger orderId,@PathVariable("orderTime") String orderTime,@PathVariable("storeId") int storeId,@PathVariable("carID") int carID,@PathVariable("userId") int userId,@PathVariable("orderStatus") String orderStatus);

	@RequestMapping(method = RequestMethod.POST, value = "/orderserver/paybyorderid?orderId={orderId}")
	public void setPayOrderStatus(@PathVariable("orderId") BigInteger orderId);
}
